package com.marvels.approve.mqueues.service.impl;

import com.alibaba.fastjson.JSON;
import com.dragon.rabbitmq.service.AcLoanStatusListener;
import com.marvels.approve.mqueues.service.ApproveILoanApplyMqProduct;
import com.marvels.common.dto.SynLoanStatus2ApplyDTO;
import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.common.utils.MarvelsLogUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApproveLoanApplyMqProductServiceImpl implements ApproveILoanApplyMqProduct {
	
	@Autowired
	private AcLoanStatusListener acLoanStatusListener;
	
	@Override
	public void synLoanStatus2Apply(SynLoanStatus2ApplyDTO synStatus) throws MarvelsBusinessException {
		// TODO Auto-generated method stub
		String json = JSON.toJSONString(synStatus);
		acLoanStatusListener.onMessage(json);
		//amqpTemplate.convertAndSend(platformNamePrefix + "acLoanStatus1",json);
		MarvelsLogUtil.getInstance().info("开发完毕json...."+json);
	}

}
